<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

//后台路由

//后台登录页面展示路由
Route::get('/admin/public/login', 'Admin\PublicController@login')->name('login');
//后台登录验证
Route::post('/admin/public/checkLogin', 'Admin\PublicController@checkLogin');
//用户退出路由
Route::get('/admin/public/logout', 'Admin\PublicController@logout');
//路由保护的路由群组
Route::group(['prefix' => 'admin', 'middleware' => 'auth:admin'], function () {
    //展示后台首页
    Route::get('index/index', 'Admin\IndexController@index');
    Route::get('index/welcome', 'Admin\IndexController@welcome');
    //管理员列表路由
    Route::get('admin/index','Admin\AdminController@index');//列表页面
    Route::any('admin/add','Admin\AdminController@add');//列表页面
    Route::get('admin/del','Admin\AdminController@del');//列表页面
    Route::any('admin/edit','Admin\AdminController@edit');//列表页面
});
